package com.example.android_demo2.room

import androidx.room.Dao
import androidx.room.Delete
import androidx.room.Insert
import androidx.room.Query

@Dao
interface UserDao {
    @Query("SELECT * FROM user")
    fun getAll(): List<User>

    @Query("SELECT * FROM user WHERE uid IN (:userIds)")
    fun loadAddByIds(userIds: IntArray): List<User>

    @Query("SELECT * FROM user WHERE first_name LIKE :first AND" +
    "last_name LIKE :last LIMIT 1")
    fun findByName(first: String ,last: String): User

    @Insert
    fun insertALl(vararg users: User)

    @Delete
    fun delete(user: User)
}